<?php use_stylesheet('tasks.css') ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="/images/mainpage-sliced_16.jpg">
  <tr>
    <td width="20" height="40">&nbsp;</td>
    <td class="style5" style="border-right:solid 1px #FFFFFF;">Milestones of Project {<?php echo $sf_user->getAttribute('selectedProject')?>}</td>
  </tr>
</table>
<?php 
if (count($milestones) == 0)
{
  echo "<p class=\"errormessage\">There are no milestones for this Project</p>";
}
else
{
?>
<table width="100%">
  <thead>
    <tr class="style2" background="/images/mainpage-sliced_11.jpg">  
      <th>Name</th>
      <th>Create Date</th>
      <th>Start Date</th>
      <th>End Date</th>
      <th>Estimated Cost</th>
      <th>Version</th>
    </tr>
  </thead>
  <tbody>
    <?php 
	foreach ($milestones as $i => $milestone): 
	?>
    <tr align="center" class="regulartext_<?php echo fmod($i, 2) ? 'even' : 'odd' ?>">
      <td style="text-decoration:underline"><a href="<?php echo url_for('milestone/show?milestoneid='.$milestone->getMilestoneid()) ?>"><?php echo $milestone->getName() ?></a></td>
  
      <td><?php echo date('j-M-Y', strtotime($milestone->getCreatedate())) ?></td>
      <td><?php echo date('j-M-Y', strtotime($milestone->getStartdate())) ?></td>
      <td><?php echo date('j-M-Y', strtotime($milestone->getEnddate())) ?></td>
      <td><?php echo number_format($milestone->getEstimatedcost()) ?></td>
      <td><?php echo $milestone->getVersion() ?></td>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>
<?php }?>
<hr/>
<?php
if ($sf_user->hasPermission("milestone.create"))
{
?>
<div class="regulartext"><a href="<?php echo url_for('milestone/new') ?>">Create New Milestone</a></div>
<?php
}
?>